import request from '../utils/request';

// 仓库列表
export const list = (params) => request({
  url: '/api/dashboard/v1/warehouse',
  params
})

// 添加仓库
export const add = (data) => request({
  url: '/api/dashboard/v1/warehouse',
  method: 'post',
  data
})

// 更新仓库
export const update = (data) => request({
  url: `/api/dashboard/v1/warehouse/${data.id}`,
  method: 'put',
  data
})

// 删除仓库
export const remove = (id) => request({
  url: `/api/dashboard/v1/warehouse/${id}`,
  method: 'delete'
})

// 禁用仓库
export const forbid = (id) => request({
  url: `/api/dashboard/v1/warehouse/${id}/forbid`,
  method: 'patch'
})

// 弃用仓库
export const resume = (id) => request({
  url: `/api/dashboard/v1/warehouse/${id}/resume`,
  method: 'patch'
})
